package org.ccams.dao;

import java.util.List;

import org.ccams.domain.TGoodskind;
import org.ccams.util.PageParameter;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class TGoodskindDAO extends SqlMapClientDaoSupport{

    
    public TGoodskindDAO() {
        super();
    }

   
    public int insert(TGoodskind record) {
        return getSqlMapClientTemplate().update("t_goodskind.abatorgenerated_insert", record);
    }

    
    public int updateByPrimaryKey(TGoodskind record) {
        int rows = getSqlMapClientTemplate().update("t_goodskind.abatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    public int updateByPrimaryKeySelective(TGoodskind record) {
        int rows = getSqlMapClientTemplate().update("t_goodskind.abatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    
    public TGoodskind selectByPrimaryKey(Integer idtGoodskind) {
        TGoodskind key = new TGoodskind();
        key.setIdtGoodskind(idtGoodskind);
        TGoodskind record = (TGoodskind) getSqlMapClientTemplate().queryForObject("t_goodskind.abatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    
    public int deleteByPrimaryKey(Integer idtGoodskind) {
        TGoodskind key = new TGoodskind();
        key.setIdtGoodskind(idtGoodskind);
        int rows = getSqlMapClientTemplate().delete("t_goodskind.abatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }
    /**
	 * 返回指定页码的数据
	 * @return
	 */
	@SuppressWarnings({ "unchecked", "deprecation" })
	public  List<TGoodskind> getTGoodskind(PageParameter pageParmeter){		
		return getSqlMapClientTemplate().queryForList("t_goodskind.getByPage", pageParmeter);
	}
	
	/**
	 * 返回记录总数
	 * @return
	 */
	public int getCount(){
		return (Integer)getSqlMapClientTemplate().queryForObject("t_goodskind.getCount");
	}
	/**
	 * 返回所有
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public  List<TGoodskind> getAll(){		
		return getSqlMapClientTemplate().queryForList("t_goodskind.getAll");
	}
}